package person.learn.controller.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import person.learn.entity.User;
import person.learn.repository.UserRepository;

/**
 * Created by LeeXyan on 2017/01/19.
 */
@Controller("/isValidDate")
public class testController {
    @Autowired
    private UserRepository  userRepository;

    @RequestMapping("/add")
    public User userAdd(){
        User user = new User();
        String id="12";
        String name="zhangsan";
        user.setId(id);
        user.setUserName(name);
        return userRepository.save(user);
    }
}
